//
//  AJAppHelper.swift
//  OneDollar
//
//  Created by leeqb on 11/13/15.
//  Copyright © 2015 powerlee. All rights reserved.
//

class AJAppHelper: UIResponder {
    
    class func initApp() {
        CodeBase.shareInstance().initConfig("Config.plist")
        
        // Http请求附加参数
        CBNetworkHelper.shareInstance().beforeBlock = { (params: [NSObject : AnyObject]!) -> [NSObject : AnyObject]! in
            let finalParams = params
            return finalParams
        }
        
        // 初始化友盟
        AJAppHelper.initUmeng()
        
        // 初始化城市数据
        DataManager.initCityInfo()
    }
    
    class func initUmeng() {
        MobClick.startWithAppkey("566a6812e0f55a58b6001a9c")
        UMSocialData.setAppKey("566a6812e0f55a58b6001a9c")
        //UMSocialData.openLog(true)
        
        UMSocialWechatHandler.setWXAppId("wxf76809cc0094b799", appSecret: "3bd7ec1720815a2358a9ae00dac6125d", url: "http://www.umeng.com/social")
        UMSocialQQHandler.setQQWithAppId("1105016898", appKey: "mFedBVH5qQnKAZX3", url: "http://www.umeng.com/social")
        UMSocialSinaHandler.openSSOWithRedirectURL("http://sns.whalecloud.com/sina2/callback")
    }
    
}
